#pragma once
#include <vector>
#include<fstream>
using namespace std;
typedef struct position {
	int x;
	int y;
} Position;
typedef struct MazeBlock
{
	Position position;//位置
	bool isWall;
	bool isGold;//是否是金币
	bool isTrap;//是否是陷阱
	bool isLocker;//是否是机关
}MazeBlock;

class MazeMap {
public:
	MazeMap(int size) {
		this->size = size;
		for (int i = 0; i < size; i++)
		{
			vector<MazeBlock> row;
			for (int j = 0; j < size; j++)
			{
				MazeBlock block;
				block.position.x = i;
				block.position.y = j;
				block.isWall = false; // 初始状态不是墙
				block.isGold = false; // 初始状态不是金币
				block.isTrap = false; // 初始状态不是陷阱
				block.isLocker = false; // 初始状态不是机关
				row.push_back(block);
			}
			map.push_back(row);
		}
		
	};
	int size;
	Position start;//入口
	Position exit;//出口
	Position boss;//boss
	vector<vector<MazeBlock>>map;
private:


};
class Player {
public:
	Player(Position position) 
	{
		this->playerPosition = position;
        // 初始化玩家数据
		this->hp = 100;
		this->attack = 5;
		this->gold = 0;
		this->ult = 10;
	};
	Position playerPosition;
	bool isAlive()
	{
		if (hp <= 0) {
			return false;
		}
		return true;
	}
	int hp;//玩家生命值
	int gold;
	int attack;
	int ult;//终结技！

};
class Boss{
public:
	Boss(Position position)
	{
		this->bossPosition = position;
        // 初始化BOSS数据
		this->bossHp = 50;
		this->bossAtk = 8;
	};
	Position bossPosition;
	int bossHp;//boss生命值
	int bossAtk;
};
void InitMaze(int size);
void DivideMaze(int x1, int x2, int y1, int y2, vector<vector<MazeBlock>>& map);
void DrawMaze(const MazeMap& maze);
void WriteMazeToFile(const MazeMap& maze, const string& filename);

// =================================================================
// ========== 此项是为第五部分“BOSS战策略优化”添加的代码 ==========
// =================================================================
#include <string>

struct Skill {
	std::string name;
	int damage;
	int cooldown;
};

void plan_and_execute_boss_battle();

